import request from '@/utils/request.js'

/**
 * 点赞
 * @param playlistId
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const like = (playlistId) =>
  request.post(`/like`, {
    playlistId
  })

/**
 * 获取用户喜欢的歌单
 * @param params
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const getLikePlaylistPage = (params) =>
  request.get(`/like/page`, { params })

/**
 * 取消点赞
 * @param playlistId
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const cancelLike = (playlistIds) =>
  request.delete(`/like/cancel/like`, {
    data: playlistIds
  })
